{% extends "administrative/base.html" %}

{% block page_link %}
    <script src="../../static/administrative/js/add_template.js"></script>
    <link rel="stylesheet" href="../../static/administrative/css/style.css">
    <script src="../../static/public_file/js/wangEditor.min.js" type="text/javascript" charset="UTF-8"></script>
{% endblock %}


{% block style %}
    <style>
        .add_class{
            background: #1E90FF;
        }
        .preserve{
            height: 30px;width: 90%;background: #0070c1;color: #ffffff;border-radius: 3px
        }
        .input-style{display: inline-block;width: 70%;height: 35px;border-radius: 7px;font-size: 14px;padding-left: 1%;border: #cfcfcf solid 1px;}
    </style>
{% endblock %}



{% block right_content %}
    <div class="headline">
        <div style="width: 15%;height: 100%;line-height: 40px;float: left;padding-left: 1%;">
            <a href="document_template.html" style="color: #0b0b0b;">
                <i class="iconfont icon-xieyimoban"></i>
                <span> 公文模版</span><span> > </span><span><a href="#">{{ nav_header }}</a></span>
            </a>
        </div>

        <div style="width: 7%;text-align: center;height: 100%;line-height: 40px;float: right;">
            <button id="add_station" type="button" class="btn btn-default add-station preserve" onclick="save_template({{ templateId }})">提交</button>
        </div>
    </div>


    <div class="right-box" style="width: 100%;height: 93%;overflow: auto;margin-top: 1px;">
        <div style="width: 100%;height: 80px;">
            <div style="width: 98%;height: 100%;color: #0b0b0b;background: white;margin-top: 0.5%;margin-left: 1%;line-height: 80px;padding-left: 2%;">
                <label for="">模版名称：</label>
                <input id="template_name" type="text" class="input-style" value="{{ templateName }}" placeholder="{{ templateName }}">
            </div>
        </div>

        <div style="width: 100%;height: 35px;line-height: 35px;color: #0b0b0b;">
            <div style="width: 98%;color: #0b0b0b;background: white;margin-top: 0.5%;margin-left: 1%;padding-left: 1%;">
                <label for="">公文文件头：</label>
            </div>
        </div>

        <div style="width: 100%;">
            <div style="width: 98%;color: #0b0b0b;background: white;margin-top: 0.5%;margin-left: 1%;">
                <div id="summernote" style="width: 100%;">
                    {% autoescape off %}
                        {{ file_header }}
                    {% endautoescape %}
                </div>
            </div>

        </div>

        <div style="width: 100%;height: 35px;line-height: 35px;color: #0b0b0b;">
            <div style="width: 98%;color: #0b0b0b;background: white;margin-top: 0.5%;margin-left: 1%;padding-left: 1%;">
                <label for="">公文文件尾：</label>
            </div>
        </div>

        <div style="width: 100%;">
            <div style="width: 98%;color: #0b0b0b;background: white;margin-top: 0.5%;margin-left: 1%;">
                <div id="summernote1" style="width: 100%;">
                    {% autoescape off %}
                        {{ file_end }}
                    {% endautoescape %}
                </div>
            </div>

        </div>
    </div>

{% endblock %}


{% block script %}
    <script>
        const E = window.wangEditor;
        const editor = new E("#summernote");
        editor.config.uploadImgShowBase64 = 'true';
        editor.placeholder = "qin";
        editor.create();

        const editor1 = new E("#summernote1");
        editor1.config.uploadImgShowBase64 = 'true';
        editor1.placeholder = "qin";
        editor1.create();

        function click_ul_9() {
            if (document.getElementById("jiantou5").className === "iconfont icon-jiantou-shang"){
                document.getElementById("jiantou5").className = "iconfont icon-jiantou-xia";
                document.getElementById("dispatch-Administrator-1").style.display = "inline-block";
            }else {
                document.getElementById("jiantou5").className = "iconfont icon-jiantou-shang";
                document.getElementById("dispatch-Administrator-1").style.display = "none";
            }
        }

        function click_ul_10() {
            if (document.getElementById("jiantou4").className === "iconfont icon-jiantou-shang"){
                document.getElementById("jiantou4").className = "iconfont icon-jiantou-xia";
                document.getElementById("dispatch-Administrator").style.display = "inline-block";
            }else {
                document.getElementById("jiantou4").className = "iconfont icon-jiantou-shang";
                document.getElementById("dispatch-Administrator").style.display = "none";
            }
        }
    </script>
{% endblock %}
